User's guide /

/

Automated tasks

Email Notification Functions


Sending a Notification Email to a Contact or Employee

The SendReminderOverEmail function allows you to send a reminder email to a contact or employee in the specified module.

Parameters

  • MODULE: The module where the notification will be set.
  • FIELD: Name of the field related to Contacts/Staff.
  • DATE: Name of the date field.
  • DAYS: Number of days before the specified date when the email will be sent.
  • TEMPLATE: Name of the email template (located in /modules/email_templates/all).
  • CONDITION: Additional logic to filter when the email is sent (e.g., status_id = 2).
  • POSTPROCESSING: After sending the email, the system updates a field (e.g., status_id = 3).

Example

staff|test@test|end_date|14|staff_departure_notification|active IS TRUE|status_id = 1


Sending a Notification Email to a Static Email Address

The SendReminderOverEmail_Alt function sends a notification email to a static email address.

Parameters

  • MODULE: The module where the notification will be set.
  • EMAIL: Static email address for the recipient.
  • DATE: Name of the date field.
  • DAYS: Number of days before the specified date when the email will be sent.
  • TEMPLATE: Name of the email template (located in /modules/email_templates/all).
  • CONDITION: Additional logic to filter when the email is sent (e.g., active IS TRUE).
  • POSTPROCESSING: After sending the email, the system updates a field (e.g., status_id = 1).

Example

staff|test@test|end_date|14|staff_departure_notification|active IS TRUE|status_id = 1


Sending a Notification Email with PDF Attachment

The SendReminderOverEmailWithPDF function sends a reminder email with an attached PDF document to a contact, user, or staff member. This function is used within the main scheduler.

Parameters

  • MODULE: The module where the notification will be set (e.g., invoices, staff).
  • RECIPIENT FIELD: A field referencing contacts, users, or staff. Alternatively, this can be a module with filter groups (e.g., invoices_groups).
  • DATE FIELD: The date field used to trigger the notification.
  • DAYS BEFORE EXPIRATION: Number of days before the specified date when the email should be sent.
  • EMAIL TEMPLATE: Name of the email template to be used (located in /modules/email_templates/all).
  • ADDITIONAL LOGIC: Optional logic to add further conditions for when the email is sent (e.g., status_id in (1, 2, 3)).
  • POSTPROCESSING: Actions performed after sending the email, such as updating a field in the target module (e.g., status_id = 2).

Additional Logic

This parameter allows you to set conditions to further refine when the email is sent. Example:

status_id in (1, 2, 3)

Postprocessing

Once the email is sent, you can define actions to be carried out in the system. For example, you can change the status of a document to status_id = 2 to indicate the process has been completed.

Example

An example of how the function can be used:

invoices|contactid|due_date|5|invoice_due_reminder|status_id = 1|status_id = 2